<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  <cpn></cpn>
  <cpn>
<!--  目的是获取子组件中的planguages
      2.通过slot-scope获取子组件中的值-->
    <template slot-scope="slot">
<!--<span v-for="item in slot.data">{{item}}&#45;&#45;</span>-->
      <span>{{slot.data.join('--')}}</span>
    </template>
  </cpn>
</div>

<template id="cpn">
  <div>
<!--   1. data值随便取，用：data将值从子组件中传出来-->
    <slot :data="planguages">
      <ul>
        <li v-for="item in planguages">{{item}}</li>
      </ul>
    </slot>

  </div>
</template>
  <script src="../../../project_practice/lunbotu/vue.js"></script>
  <script>
    const app = new Vue({
      el:'#app',
      data:{
        message:"你好啊！！"
      },
      components:{
        cpn:{
          template:"#cpn",
          data(){
            return{
              planguages:['javascript','C++','swift','Python','Go','C#','Java']
            }
          }
        }
      }
    })
  </script>
</body>
</html>